#include "libutil.h"
#include "llist.h"

void print(const void* num)
{
  printf("%d\n", *((const int*)num));
}


int cmp(const void *n, const void *m)
{
  return *((const int*)n) - *((const int*)m);
}


int main()
{
 
  list_t *list = make_empty_list();
  int arra[5] = { 7, 10, 213, 111 , 1234};

  insert_at_foot(list, &arra[0]); 
  insert_at_foot(list, &arra[1]);
  insert_at_foot(list, &arra[2]);
  insert_at_foot(list, &arra[3]);

//  printList(list, print);
 
  sort_list(list, cmp); 

  //printList(list, print);
 
  insert_in_order(list, &arra[4], cmp);

  printList(list, print);
 
  return 0;
}
